import random


def generate_test_case():
    # Generate a valid stone sequence where frog can possibly cross
    n = random.randint(5, 15)
    stones = [0]
    current = 0
    possible_jumps = [1]

    for _ in range(1, n):
        jump = random.choice(possible_jumps)
        current += jump
        stones.append(current)
        possible_jumps = [jump - 1, jump, jump + 1]
        possible_jumps = [x for x in possible_jumps if x > 0]

    return stones


def generate_impossible_case():
    # Generate an impossible stone sequence
    n = random.randint(5, 15)
    stones = sorted(random.sample(range(0, 100), n))
    # Ensure the first stone is 0 and second is 1 (as per problem constraints)
    stones[0] = 0
    if 1 not in stones:
        stones[1] = 1
        stones = sorted(stones[:n])
    return stones


def generate_multiple_test_cases(num_cases=5):
    test_cases = []
    for _ in range(num_cases // 2):
        test_cases.append((generate_test_case(), True))
    for _ in range(num_cases - (num_cases // 2)):
        test_cases.append((generate_impossible_case(), False))
    random.shuffle(test_cases)
    return test_cases


if __name__ == "__main__":
    test_cases = generate_multiple_test_cases()
    for i, (stones, expected) in enumerate(test_cases):
        print(f"\nTest Case {i + 1}:")
        print(f"stones: {stones}")
        print(f"Expected result: {expected}")